﻿<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
 
    <script type='text/html' template> 
        <input type='hidden' name='PID' value="{{ d.params.PID || '' }}"/>
    </script>    
    <div class='layui-form-item'>
        <label class='layui-form-label'>下单人 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template lay-done='layui.data.getSelSource(d.params,"User_SelSource");'>
                    <select name='User_SelSource' readonly='readonly' id='User_SelSource' lay-search></select>
                </script>
            </div>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>订单编号</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='OrderNumber' value='{{ d.params.OrderNumber || '' }}' lay-verify='required' placeholder='订单编号' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>订单金额</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='OrderPrice' value='{{ d.params.OrderPrice || '' }}' lay-verify='required' placeholder='订单金额' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>优惠金额</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='DiscountPrice' value='{{ d.params.DiscountPrice || '' }}' lay-verify='required' placeholder='优惠金额' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>运费</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='FarePrice' value='{{ d.params.FarePrice || '' }}' lay-verify='required' placeholder='运费' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>支付金额</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='PayPrice' value='{{ d.params.PayPrice || '' }}' lay-verify='required' placeholder='支付金额' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>退款金额</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='ReturnPrice' value='{{ d.params.ReturnPrice || '' }}' lay-verify='required' placeholder='退款金额' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>备注</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='RMK' value='{{ d.params.RMK || '' }}' lay-verify='required' placeholder='备注' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>     
    <div class='layui-form-item'>
        <label class='layui-form-label'>订单状态 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='State_Sel'>                      <option value='0' {{ d.params.State_Sel == '0' ? 'selected' : '' }}>待支付</option>                      <option value='1' {{ d.params.State_Sel == '1' ? 'selected' : '' }}>待发货</option>                      <option value='2' {{ d.params.State_Sel == '2' ? 'selected' : '' }}>部分发货</option>                      <option value='3' {{ d.params.State_Sel == '3' ? 'selected' : '' }}>已发货</option>                      <option value='4' {{ d.params.State_Sel == '4' ? 'selected' : '' }}>已完成</option>                      <option value='5' {{ d.params.State_Sel == '5' ? 'selected' : '' }}>取消</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
         
    <div class='layui-form-item'>
        <label class='layui-form-label'>售后状态 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='AfterSaleState_Sel'>                      <option value='0' {{ d.params.AfterSaleState_Sel == '0' ? 'selected' : '' }}>无售后信息</option>                      <option value='1' {{ d.params.AfterSaleState_Sel == '1' ? 'selected' : '' }}>申请售后未处理</option>                      <option value='2' {{ d.params.AfterSaleState_Sel == '2' ? 'selected' : '' }}>已处理</option>                      <option value='3' {{ d.params.AfterSaleState_Sel == '3' ? 'selected' : '' }}>不予处理或取消</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
         
    <div class='layui-form-item'>
        <label class='layui-form-label'>订单取消退款状态 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='DistributionState_Sel'>                      <option value='0' {{ d.params.DistributionState_Sel == '0' ? 'selected' : '' }}>无需退款</option>                      <option value='1' {{ d.params.DistributionState_Sel == '1' ? 'selected' : '' }}>待退款</option>                      <option value='2' {{ d.params.DistributionState_Sel == '2' ? 'selected' : '' }}>已退款</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
         
    <div class='layui-form-item'>
        <label class='layui-form-label'>开票状态 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='InvoiceState_Sel'>                      <option value='0' {{ d.params.InvoiceState_Sel == '0' ? 'selected' : '' }}>未开票</option>                      <option value='1' {{ d.params.InvoiceState_Sel == '1' ? 'selected' : '' }}>已开票</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
         
    <div class='layui-form-item'>
        <label class='layui-form-label'>物流状态 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='ExpressState_Sel'>                      <option value='0' {{ d.params.ExpressState_Sel == '0' ? 'selected' : '' }}>未发货</option>                      <option value='1' {{ d.params.ExpressState_Sel == '1' ? 'selected' : '' }}>已发货</option>                      <option value='2' {{ d.params.ExpressState_Sel == '2' ? 'selected' : '' }}>待签收</option>                      <option value='3' {{ d.params.ExpressState_Sel == '3' ? 'selected' : '' }}>已签收</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
         
    <div class='layui-form-item'>
        <label class='layui-form-label'>审核状态 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='ExamineState_Sel'>                      <option value='0' {{ d.params.ExamineState_Sel == '0' ? 'selected' : '' }}>无需审核</option>                      <option value='1' {{ d.params.ExamineState_Sel == '1' ? 'selected' : '' }}>审核中</option>                      <option value='2' {{ d.params.ExamineState_Sel == '2' ? 'selected' : '' }}>审核完成</option>                      <option value='3' {{ d.params.ExamineState_Sel == '3' ? 'selected' : '' }}>已驳回</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>排序</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Sort' value='{{ d.params.Sort || '' }}' lay-verify='required|number' placeholder='排序' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系人</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='UserName' value='{{ d.params.UserName || '' }}' lay-verify='required' placeholder='联系人' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系单位</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='UserCompany' value='{{ d.params.UserCompany || '' }}' lay-verify='required' placeholder='联系单位' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系电话</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='UserTel' value='{{ d.params.UserTel || '' }}' lay-verify='required' placeholder='联系电话' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系地址</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='UserAddress' value='{{ d.params.UserAddress || '' }}' lay-verify='required' placeholder='联系地址' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>     
    <div class='layui-form-item'>
        <label class='layui-form-label'>配送方式 </label>
        <div class='layui-input-block'>
            <div class='layui-input-inline'>
                <script type='text/html' template>
                    <select readonly='readonly' name='DistributionMode_Sel'>                      <option value='0' {{ d.params.DistributionMode_Sel == '0' ? 'selected' : '' }}>快递</option>                      <option value='1' {{ d.params.DistributionMode_Sel == '1' ? 'selected' : '' }}>自提</option>
                    </select>
                </script> 
            </div>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>自提点地址</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='PickAddress' value='{{ d.params.PickAddress || '' }}' lay-verify='required' placeholder='自提点地址' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>自提点ID</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='PickID' value='{{ d.params.PickID || '' }}' lay-verify='required' placeholder='自提点ID' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>交易单号</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='BillCode' value='{{ d.params.BillCode || '' }}' lay-verify='required' placeholder='交易单号' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>买家付款时间</label>
        <div class='layui-input-inline'>
            <script type='text/html' template lay-done='layui.data.datedone(d.params);'>
                <input type='text' readonly='readonly' name='PayTime' readonly='readonly' id='PayTime' value='{{ d.params.PayTime || '' }}' lay-verify='datetime' placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>支付方式</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='PayMode' value='{{ d.params.PayMode || '' }}' lay-verify='required' placeholder='支付方式' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>卖家发货时间</label>
        <div class='layui-input-inline'>
            <script type='text/html' template lay-done='layui.data.datedone(d.params);'>
                <input type='text' readonly='readonly' name='DeliverTime' readonly='readonly' id='DeliverTime' value='{{ d.params.DeliverTime || '' }}' lay-verify='datetime' placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>确认收货时间</label>
        <div class='layui-input-inline'>
            <script type='text/html' template lay-done='layui.data.datedone(d.params);'>
                <input type='text' readonly='readonly' name='ConfirmTime' readonly='readonly' id='ConfirmTime' value='{{ d.params.ConfirmTime || '' }}' lay-verify='datetime' placeholder='yyyy-MM-dd HH:mm:ss' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
       
    <div class='layui-form-item'>
        <label class='layui-form-label'>是否已评价 0.未评价 1.已评价</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='IsEval' value='{{ d.params.IsEval || '' }}' lay-verify='required|number' placeholder='是否已评价 0.未评价 1.已评价' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>店铺ID</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='StoreID' value='{{ d.params.StoreID || '' }}' lay-verify='required' placeholder='店铺ID' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>供应商ID</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='SupplierID' value='{{ d.params.SupplierID || '' }}' lay-verify='required' placeholder='供应商ID' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>商品数据 (检索)</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='GoodsData' value='{{ d.params.GoodsData || '' }}' lay-verify='required' placeholder='商品数据 (检索)' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>商品ID集合 (检索)</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='GoodIds' value='{{ d.params.GoodIds || '' }}' lay-verify='required' placeholder='商品ID集合 (检索)' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>商品分类ID集合 (检索)</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='GoodCateIds' value='{{ d.params.GoodCateIds || '' }}' lay-verify='required' placeholder='商品分类ID集合 (检索)' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>是否使用优惠卷 [0.否|1.是]</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='IsUseCoupon' value='{{ d.params.IsUseCoupon || '' }}' lay-verify='required|number' placeholder='是否使用优惠卷 [0.否|1.是]' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>优惠卷使用信息</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='CouponInfo' value='{{ d.params.CouponInfo || '' }}' lay-verify='required' placeholder='优惠卷使用信息' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>是否团购单 [0.否|1.是]</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='IsGroupBuy' value='{{ d.params.IsGroupBuy || '' }}' lay-verify='required|number' placeholder='是否团购单 [0.否|1.是]' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>团购信息</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='GroupBuyInfo' value='{{ d.params.GroupBuyInfo || '' }}' lay-verify='required' placeholder='团购信息' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>结算状态 [0.未结算|1.已结算]</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='SettleState' value='{{ d.params.SettleState || '' }}' lay-verify='required|number' placeholder='结算状态 [0.未结算|1.已结算]' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>扩展1</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Extend1' value='{{ d.params.Extend1 || '' }}' lay-verify='required' placeholder='扩展1' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>扩展2</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Extend2' value='{{ d.params.Extend2 || '' }}' lay-verify='required' placeholder='扩展2' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>   
    <div class='layui-form-item'>
        <label class='layui-form-label'>扩展3</label>
        <div class='layui-input-inline'>
            <script type='text/html' template>
                <input type='text' readonly='readonly' name='Extend3' value='{{ d.params.Extend3 || '' }}' lay-verify='required' placeholder='扩展3' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div> 
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button"  onclick="Close()" value="关闭" class="layui-btn">
        </div>
    </div>
</div>

<script type="text/javascript">  
    function Close(){
        layer.closeAll();
    }

    layui.use(['form','admin','upload','laydate'], function () {
        var form = layui.form;//required（必填项）phone（手机号）email（邮箱）url（网址）number（数字）date（日期）identity（身份证） 自定义值
    });
    
    
    layui.data.getSelSource = function (d,sourceName) { 
            var $ = layui.$;
            var form = layui.form;
            var admin = layui.admin;

            if (sourceName == "User_SelSource") {
                admin.req({
                    url: layui.setter.APIUrl + '/admin/userMgr/customerQuery', //实际使用请改成服务端真实接口
                    type: 'post',
                    done: function (res) {
                        //$("#User_SelSource").append("<option value=''>全部</option>");
                        layui.each(res.Data, function (index, eachdata) {
                            var strIsSel = '';
                            if (eachdata.PID == d.User_SelSource)
                                strIsSel = "selected='selected'"; 
                            $("#User_SelSource").append("<option value='" + eachdata.PID + "' " + strIsSel + ">" + eachdata.UserName + "</option>");
                        });
                        form.render('select');
                    }
                }); 
            }
 
    }
 
    
    layui.data.setUpload = function (d) { 
            var $ = layui.$,
            upload = layui.upload,
            admin = layui.admin;
            var formSelects = layui.formSelects;
 
    }

    
    layui.data.datedone = function (d) { 
            var laydate = layui.laydate;

            //日期时间选择器
            laydate.render({
                elem: '#PayTime'
              , type: 'datetime'
              , calendar: true
            });
            laydate.val = d.PayTime;

            //日期时间选择器
            laydate.render({
                elem: '#DeliverTime'
              , type: 'datetime'
              , calendar: true
            });
            laydate.val = d.DeliverTime;

            //日期时间选择器
            laydate.render({
                elem: '#ConfirmTime'
              , type: 'datetime'
              , calendar: true
            });
            laydate.val = d.ConfirmTime;
 
    }
    
</script>
